/**
 * 
 */
package com.siteseat.common.i18n;

import java.util.ArrayList;
import java.util.List;

import com.siteseat.common.exception.InternalException;

/**
 *
 */
public class DefaultErrorLabels extends Labels {

  private static DefaultErrorLabels INSTANCE;

  public static void init() throws Exception {
    INSTANCE = new DefaultErrorLabels();
    List<String> resources = new ArrayList<String>( 1 );
    resources.add( "/com/siteseat/common/i18n/error_label.json" );
    INSTANCE.setJsonResources( resources );
    INSTANCE.afterPropertiesSet();
  }

  /**
   * 
   */
  public DefaultErrorLabels() {
    if( INSTANCE != null ) {
      throw new InternalException( "Duplicated default error labels" );
    }
    INSTANCE = this;
  }

  /**
   * @param name
   * @return
   */
  public static Label get( String name ) {
    return DefaultErrorLabels.INSTANCE.getLabel( name );
  }

}
